<template>
  <div class="goodslist-contain">
    <!-- :style="'width:' + width + 'px; height:' + height + 'px;'" -->
    <div><img v-lazy="url" /></div>

    <!-- <div class="introduce" :style="'width:' + width + 'px'"> -->
    <div class="introduce">
      <div class="describe">{{ describe }}</div>
      <slot>
        <div class="text">
          <span class="price">￥{{ price }}</span
          ><span class="buy">{{ buy }}购买</span>
        </div>
      </slot>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    width: {
      type: [Number, String],
      default: 170,
    },
    height: {
      type: [Number, String],
      default: 235,
    },
    url: {
      type: String,
    },
    describe: {
      type: String,
    },
    price: {
      type: [Number, String],
    },
    buy: {
      type: [Number, String],
    },
  },
};
</script>

<style lang="scss" scoped>
.goodslist-contain {
  position: relative;
  width: 170px;
  height: 250px;
  background: #fff;
  border-radius: 5px;

  img {
    width: 100%;
    max-height: 174px;
    border-radius: 5px;
  }

  .introduce {
    position: absolute;
    bottom: 10px;
    width: 100%;

    .describe {
      overflow: hidden;
      font-size: 12px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .text {
      display: flex;
      justify-content: space-between;
      margin-top: 10px;

      .price {
        font-size: 14px;
        color: orange;
      }

      .buy {
        font-size: 12px;
        color: #999;
      }
    }
  }
}
</style>
